<template>
    <div class="container">
        <NavTop />
        <div class="info-section">
            <h2>网站名称：手工制品销售网</h2>
            <form @submit.prevent="handleSubmit">
                <div class="form-group">
                    <label for="name">姓名：</label>
                    <input type="text" id="name" v-model="formData.name" required />
                </div>
                <div class="form-group">
                    <label for="gender">性别：</label>
                    <select id="gender" v-model="formData.gender" required>
                        <option value="">请选择</option>
                        <option value="male">男</option>
                        <option value="female">女</option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="studentId">学号：</label>
                    <input type="text" id="studentId" v-model="formData.studentId" required />
                </div>
                <div class="form-group">
                    <label for="description">描述：</label>
                    <textarea id="description" v-model="formData.description" rows="4" required></textarea>
                </div>
                <button type="submit">提交</button>
            </form>
        </div>
    </div>
</template>

<script>
import NavTop from '@/components/NavTop.vue'

export default {
components: {
    NavTop
},
data() {
    return {
        formData: {
            name: '',
            gender: '',
            studentId: '',
            description: ''
        }
    }
},
methods: {
    handleSubmit() {
        console.log('提交的数据：', this.formData);
        alert('表单已提交！');
    }
}
}
</script>

<style scoped>
    .container {
    width: 80%;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }

    .info-section {
    margin-top: 20px;
    }

    .form-group {
    margin-bottom: 15px;
    }

    label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    }

    input, select, textarea {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    }

    button {
    padding: 10px 15px;
    background-color: #42b983;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    }

    button:hover {
    background-color: #36946d;
    }
</style>




